package com.gkzf.ai.module.crm.controller.admin.product;

import com.gkzf.ai.framework.common.pojo.CommonResult;
import com.gkzf.ai.module.crm.controller.admin.product.vo.productMatch.ProductMatchPageReqVO;
import com.gkzf.ai.module.crm.controller.admin.product.vo.productMatch.ProductMatchRespVO;
import com.gkzf.ai.module.crm.service.product.admin.ProductMatchService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

import static com.gkzf.ai.framework.common.pojo.CommonResult.success;

@Tag(name = "管理后台 - CRM 用户匹配产品结果")
@RestController
@RequestMapping("/crm/product-match")
@Validated
public class ProductMatchController {

    @Resource
    private ProductMatchService productMatchService;


    @GetMapping("/page")
    @Operation(summary = "获得CRM 用户匹配产品结果列表")
//    @PreAuthorize("@ss.hasPermission('crm:product-match:query')")
    public CommonResult<List<ProductMatchRespVO>> getProductMatchPage(@Valid ProductMatchPageReqVO pageReqVO) {
        List<ProductMatchRespVO> pageResult = productMatchService.getProductMatchPage(pageReqVO);
        return success(pageResult);
    }


}